
library(testthat)
library(blma)
library(tictoc)
library(parallel)

cores <- detectCores()

test_that("Kakadu produces correct results liang_g2", {
	Kakadu <- get_Kakadu()
	vy <- Kakadu$vy
	mX <- Kakadu$mX
	tic("Kakadu produces correct results liang_g2")
	result <- blma(vy, mX, prior="liang_g2", modelprior="uniform", cores=cores)
	toc()
	expect_equal(result$vinclusion_prob, c(
		0.3469442223402000,0.5033763713275141,0.1710391998737261,0.4686716902393479,
		0.9041282693203457,0.4182787535192236,0.2152694787243207,0.2365794398160196,
		0.1709195101828260,0.9081285313534141,0.9457607536048475,0.9996987392264269,
		0.1584196650685208,0.3866126303418126,0.3524291472817367,0.8329753936885853,
		0.1953702526810377,0.8655055789962616,0.9999999999992023,0.6255640528176055,
		0.9999982103316490,0.2911572010612116
	), tolerance = 1e-8)
})